package com.googlecode.bpmcenter.service;
 
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.googlecode.bpmcenter.dao.PartnerDAO;
import com.googlecode.bpmcenter.model.Partner;

@Service("partnerService")
@Transactional(readOnly = true)
public class PartnerService {
 
    @Autowired
    PartnerDAO partnerDAO;
 
    @Transactional(readOnly = false)
    public void addPartner(Partner partner) {
        getPartnerDAO().addPartner(partner);
    }
 
    @Transactional(readOnly = false)
    public void deletePartner(Partner partner) {
        getPartnerDAO().deletePartner(partner);
    }
 
    @Transactional(readOnly = false)
    public void updatePartner(Partner partner) {
        getPartnerDAO().updatePartner(partner);
    }
 
    public Partner getPartnerById(int id) {
        return getPartnerDAO().getPartnerById(id);
    }
 
    public List<Partner> getPartners() {
        return getPartnerDAO().getPartners();
    }
 
    public PartnerDAO getPartnerDAO() {
        return partnerDAO;
    }
 
    public void setPartnerDAO(PartnerDAO partnerDAO) {
        this.partnerDAO = partnerDAO;
    }
}